home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 52 / Amiga Format AFCD52 (Issue 136, May 2000).iso / -serious- / programming / other / mesa / mesa-aux / book.aux / jitter.h < prev    next >
Text File  |  2000-02-23  |  6KB  |  229 lines

  1. /*
  2.  * (c) Copyright 1993, Silicon Graphics, Inc.
  3.  * ALL RIGHTS RESERVED 
  4.  * Permission to use, copy, modify, and distribute this software for 
  5.  * any purpose and without fee is hereby granted, provided that the above
  6.  * copyright notice appear in all copies and that both the copyright notice
  7.  * and this permission notice appear in supporting documentation, and that 
  8.  * the name of Silicon Graphics, Inc. not be used in advertising
  9.  * or publicity pertaining to distribution of the software without specific,
  10.  * written prior permission. 
  11.  *
  12.  * THE MATERIAL EMBODIED ON THIS SOFTWARE IS PROVIDED TO YOU "AS-IS"
  13.  * AND WITHOUT WARRANTY OF ANY KIND, EXPRESS, IMPLIED OR OTHERWISE,
  14.  * INCLUDING WITHOUT LIMITATION, ANY WARRANTY OF MERCHANTABILITY OR
  15.  * FITNESS FOR A PARTICULAR PURPOSE.  IN NO EVENT SHALL SILICON
  16.  * GRAPHICS, INC.  BE LIABLE TO YOU OR ANYONE ELSE FOR ANY DIRECT,
  17.  * SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY
  18.  * KIND, OR ANY DAMAGES WHATSOEVER, INCLUDING WITHOUT LIMITATION,
  19.  * LOSS OF PROFIT, LOSS OF USE, SAVINGS OR REVENUE, OR THE CLAIMS OF
  20.  * THIRD PARTIES, WHETHER OR NOT SILICON GRAPHICS, INC.  HAS BEEN
  21.  * ADVISED OF THE POSSIBILITY OF SUCH LOSS, HOWEVER CAUSED AND ON
  22.  * ANY THEORY OF LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE
  23.  * POSSESSION, USE OR PERFORMANCE OF THIS SOFTWARE.
  24.  * 
  25.  * US Government Users Restricted Rights 
  26.  * Use, duplication, or disclosure by the Government is subject to
  27.  * restrictions set forth in FAR 52.227.19(c)(2) or subparagraph
  28.  * (c)(1)(ii) of the Rights in Technical Data and Computer Software
  29.  * clause at DFARS 252.227-7013 and/or in similar or successor
  30.  * clauses in the FAR or the DOD or NASA FAR Supplement.
  31.  * Unpublished-- rights reserved under the copyright laws of the
  32.  * United States.  Contractor/manufacturer is Silicon Graphics,
  33.  * Inc., 2011 N.  Shoreline Blvd., Mountain View, CA 94039-7311.
  34.  *
  35.  * OpenGL(TM) is a trademark of Silicon Graphics, Inc.
  36.  */
  37. /*
  38.  * jitter.h
  39.  * 
  40.  * This file contains jitter point arrays for 2,3,4,8,15,24 and 66 jitters.
  41.  * 
  42.  * The arrays are named j2, j3, etc. Each element in the array has the form,
  43.  * for example, j8[0].x and j8[0].y
  44.  * 
  45.  * Values are floating point in the range -.5 < x < .5, -.5 < y < .5, and
  46.  * have a gaussian distribution around the origin.
  47.  * 
  48.  * Use these to do model jittering for scene anti-aliasing and view volume
  49.  * jittering for depth of field effects. Use in conjunction with the 
  50.  * accwindow() routine.
  51.  */
  52.  
  53. typedef struct {
  54.   GLfloat x, y;
  55. } jitter_point;
  56.  
  57. #define MAX_SAMPLES  66
  58.  
  59. /*
  60.  * 2 jitter points 
  61.  */
  62. jitter_point j2[] =
  63. {
  64.   {0.246490, 0.249999},
  65.   {-0.246490, -0.249999}
  66. };
  67.  
  68. /*
  69.  * 3 jitter points 
  70.  */
  71. jitter_point j3[] =
  72. {
  73.   {-0.373411, -0.250550},
  74.   {0.256263, 0.368119},
  75.   {0.117148, -0.117570}
  76. };
  77.  
  78. /*
  79.  * 4 jitter points 
  80.  */
  81. jitter_point j4[] =
  82. {
  83.   {-0.208147, 0.353730},
  84.   {0.203849, -0.353780},
  85.   {-0.292626, -0.149945},
  86.   {0.296924, 0.149994}
  87. };
  88.  
  89. /*
  90.  * 8 jitter points 
  91.  */
  92. jitter_point j8[] =
  93. {
  94.   {-0.334818, 0.435331},
  95.   {0.286438, -0.393495},
  96.   {0.459462, 0.141540},
  97.   {-0.414498, -0.192829},
  98.   {-0.183790, 0.082102},
  99.   {-0.079263, -0.317383},
  100.   {0.102254, 0.299133},
  101.   {0.164216, -0.054399}
  102. };
  103.  
  104. /*
  105.  * 15 jitter points 
  106.  */
  107. jitter_point j15[] =
  108. {
  109.   {0.285561, 0.188437},
  110.   {0.360176, -0.065688},
  111.   {-0.111751, 0.275019},
  112.   {-0.055918, -0.215197},
  113.   {-0.080231, -0.470965},
  114.   {0.138721, 0.409168},
  115.   {0.384120, 0.458500},
  116.   {-0.454968, 0.134088},
  117.   {0.179271, -0.331196},
  118.   {-0.307049, -0.364927},
  119.   {0.105354, -0.010099},
  120.   {-0.154180, 0.021794},
  121.   {-0.370135, -0.116425},
  122.   {0.451636, -0.300013},
  123.   {-0.370610, 0.387504}
  124. };
  125.  
  126. /*
  127.  * 24 jitter points 
  128.  */
  129. jitter_point j24[] =
  130. {
  131.   {0.030245, 0.136384},
  132.   {0.018865, -0.348867},
  133.   {-0.350114, -0.472309},
  134.   {0.222181, 0.149524},
  135.   {-0.393670, -0.266873},
  136.   {0.404568, 0.230436},
  137.   {0.098381, 0.465337},
  138.   {0.462671, 0.442116},
  139.   {0.400373, -0.212720},
  140.   {-0.409988, 0.263345},
  141.   {-0.115878, -0.001981},
  142.   {0.348425, -0.009237},
  143.   {-0.464016, 0.066467},
  144.   {-0.138674, -0.468006},
  145.   {0.144932, -0.022780},
  146.   {-0.250195, 0.150161},
  147.   {-0.181400, -0.264219},
  148.   {0.196097, -0.234139},
  149.   {-0.311082, -0.078815},
  150.   {0.268379, 0.366778},
  151.   {-0.040601, 0.327109},
  152.   {-0.234392, 0.354659},
  153.   {-0.003102, -0.154402},
  154.   {0.297997, -0.417965}
  155. };
  156.  
  157. /*
  158.  * 66 jitter points 
  159.  */
  160. jitter_point j66[] =
  161. {
  162.   {0.266377, -0.218171},
  163.   {-0.170919, -0.429368},
  164.   {0.047356, -0.387135},
  165.   {-0.430063, 0.363413},
  166.   {-0.221638, -0.313768},
  167.   {0.124758, -0.197109},
  168.   {-0.400021, 0.482195},
  169.   {0.247882, 0.152010},
  170.   {-0.286709, -0.470214},
  171.   {-0.426790, 0.004977},
  172.   {-0.361249, -0.104549},
  173.   {-0.040643, 0.123453},
  174.   {-0.189296, 0.438963},
  175.   {-0.453521, -0.299889},
  176.   {0.408216, -0.457699},
  177.   {0.328973, -0.101914},
  178.   {-0.055540, -0.477952},
  179.   {0.194421, 0.453510},
  180.   {0.404051, 0.224974},
  181.   {0.310136, 0.419700},
  182.   {-0.021743, 0.403898},
  183.   {-0.466210, 0.248839},
  184.   {0.341369, 0.081490},
  185.   {0.124156, -0.016859},
  186.   {-0.461321, -0.176661},
  187.   {0.013210, 0.234401},
  188.   {0.174258, -0.311854},
  189.   {0.294061, 0.263364},
  190.   {-0.114836, 0.328189},
  191.   {0.041206, -0.106205},
  192.   {0.079227, 0.345021},
  193.   {-0.109319, -0.242380},
  194.   {0.425005, -0.332397},
  195.   {0.009146, 0.015098},
  196.   {-0.339084, -0.355707},
  197.   {-0.224596, -0.189548},
  198.   {0.083475, 0.117028},
  199.   {0.295962, -0.334699},
  200.   {0.452998, 0.025397},
  201.   {0.206511, -0.104668},
  202.   {0.447544, -0.096004},
  203.   {-0.108006, -0.002471},
  204.   {-0.380810, 0.130036},
  205.   {-0.242440, 0.186934},
  206.   {-0.200363, 0.070863},
  207.   {-0.344844, -0.230814},
  208.   {0.408660, 0.345826},
  209.   {-0.233016, 0.305203},
  210.   {0.158475, -0.430762},
  211.   {0.486972, 0.139163},
  212.   {-0.301610, 0.009319},
  213.   {0.282245, -0.458671},
  214.   {0.482046, 0.443890},
  215.   {-0.121527, 0.210223},
  216.   {-0.477606, -0.424878},
  217.   {-0.083941, -0.121440},
  218.   {-0.345773, 0.253779},
  219.   {0.234646, 0.034549},
  220.   {0.394102, -0.210901},
  221.   {-0.312571, 0.397656},
  222.   {0.200906, 0.333293},
  223.   {0.018703, -0.261792},
  224.   {-0.209349, -0.065383},
  225.   {0.076248, 0.478538},
  226.   {-0.073036, -0.355064},
  227.   {0.145087, 0.221726}
  228. };
  229.